home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Jul 89 / W0077-MPW Pascal bug!-Jul89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.1 KB  |  60 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  BURBECK.S    to ALCABES
  2.  
  3. Item forwarded  by  MACAPP.TEST  to SYMEONIDES.M
  4.  
  5. Item    6363916                         17-July-89        07:28
  6.  
  7. From:   CDA0004                         VAR Shana Enterprises, Don Murphy
  8.  
  9. To:     MACAPP.TECH$                    MACAPP Tech
  10.  
  11. Sub:    MPW Pascal bug!
  12.  
  13. Hello Everyone,
  14.  
  15. Here's a nasty little bug in mpw pascal 3.0 that might get you:
  16. (if you're listening, DTS, you've already heard this - Jon Zap 15-june)
  17.  
  18.  
  19. TYPE
  20.     TFoo = OBJECT
  21.     TBar = OBJECT (TFoo)
  22.  
  23.  
  24. PROCEDURE MakeFoo (VAR aFoo : TFoo);
  25. BEGIN
  26.     NEW (aFoo)
  27.     aFoo.IFoo;
  28. END;
  29.  
  30.  
  31. PROCEDURE MakeBar (VAR aBar : TBar);
  32. BEGIN
  33.     NEW (aBar);
  34.     aBar.IBar;
  35. END;
  36.  
  37.  
  38.  
  39. PROCEDURE Anything;
  40. VAR
  41.     aFoo : TFoo;
  42.  
  43. BEGIN
  44.     MakeFoo (aFoo);         { Works fine. }
  45.     MakeBar (TBar(aFoo))    { Invariably leaves aFoo unspecified }
  46.     MakeFoo (TFoo(aFoo))    { Surprisingly bombs out as well }
  47. END;
  48.  
  49.  
  50. It seems that any type casting on the VAR parameter causes the result to get
  51. lost before it reaches the calling procedure.
  52.  
  53. Oh well.
  54.  
  55. Regards,
  56.  
  57. Wayne Malkin
  58.  
  59.  
  60.